<!DOCTYPE html>
<html>
	<head>
		<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
		<meta charset="utf-8">
		<title>result</title>
		<style type="text/css">
	
		</style>
	</head>
	<body>
		<span class="query-count"></span>
		<div id="p" >
				
		</div>
		<script type="text/javascript">
			$(function(){
				$('#p').panel({
					width:'auto',
					height:'auto',
					border:false,
					href:'search_result?page=1&rows=10&keywords='+$.cookie('keywords'),
					extractor:function(data){
						
						var obj = JSON.parse(data);
						var files = obj.rows;
						var str ="";		
						if(obj.total < 1){
							return "很抱歉，没有找到与“<font color=red>"+$.cookie('keywords')+"</font>”相关的内容";
						}
				
						var times = obj.total-obj.offset;
						for(var i=0; i<times; i++){
							str +=  	"<div style='width:392px;margin-bottom:14px;'>";
							str +=			"<h3 style='margin: 0px;'><a href="+files[i].link+">"+files[i].fileName+"</a></h3>";
							str +=			"<div>";
							str +=				"<span style='white-space: pre-wrap;'>";
							str +=					files[i].notes;
							str +=				"</span>";
							str +=			"</div>";
							str +=			"<div>"; 
							str +=				"<span style='margin-right: 20px;'>"+"<font color='#828282'>提供者:</font>"+files[i].provider+"</span>";
							str +=				"<span style='margin-right: 20px;'>"+"<font color='#828282'>文件类型:</font>"+files[i].type+"</span>";
							str +=				"<span>"+"<font color='#828282'>文件大小:</font>"+files[i].size+"/byte"+"</span>";
							str +=			"</div>";
							str +=		"</div>";	
						}
						$("#bottomBar").css('display','');
						$(".query-count").text("我们为您找到相关结果约"+obj.total+"个");
						$('#pp').pagination({
							layout:['sep','prev','next','links'],
							beforePageText:'Go Page',
							afterPageText:'',
							pageSize:10,
							total:obj.total,
							onSelectPage:function(pageNumber, pageSize){
								$('#p').panel('refresh', 'search_result?page='+pageNumber+'&rows=10&keywords='+$.cookie('keywords'));
							}
						});
						return str;
					},
				});
			})
		</script>
	</body>
</html>
